import requests

keyword = input('请输入你的关键词: ')
key = 'e8c5524dd2a365f20908ced735f8e480'
resp = requests.get(
    url=f'http://api.tianapi.com/guonei/index?key={key}&num=10&word={keyword}'
)
print(resp.status_code)
result = resp.json()
if result['code'] == 200:
    for news in result['newslist']:
        print(news['title'], news['ctime'])
        print(news['url'])
